export default class RenderHooks {
  constructor () {
    this.actions = []
  }

  add (cb) {
    if (typeof cb === 'function') {
      this.actions.push(cb)
    }
  }

  remove (cb) {
    if (this.actions.includes(cb)) {
      const index = this.actions.indexOf(cb)
      this.actions.splice(index, 1)
    }
  }

  clear () {
    this.actions = []
  }
}
